import 'package:flutter/material.dart';

class DialogUtil {
  Future showAlertDialog(
    BuildContext context,
    String titleStr,
    String content,
  ) {
    return showDialog(
        context: context,
        builder: (BuildContext context) {
          return AlertDialog(
            title: Text(titleStr),
            content: Text(content),
            actions: <Widget>[
              FlatButton(
                  onPressed: () {
                    Navigator.of(context).pop('-1');
                  },
                  child: Text('取消')),
              FlatButton(
                  onPressed: () {
                    Navigator.of(context).pop('1');
                  },
                  child: Text('确定')),
            ],
          );
        });
  }
}
